<?php


namespace app\zc\validata;


use think\Validate;

class NewsValidata extends Validate
{
    protected $rule = [
        'title' => 'require|max:200',
        'id' => 'require|integer',
        'abstract' => 'require|max:5000',
        'content' =>'require|max:5000',
        'author' => 'require'
    ];
    protected $message = [
        'title.require' => '标题不能为空',
        'title.max' => '标题不能超过200个字',
        'id.require' => '参数错误',
        'id.integer' => '参数类型错误',
        'abstract.require' => '概述不能为空',
        'abstract.max' => '概述不能超过5000个字',
        'content.require' => '正文不能为空',
        'content.max' => '正文不能超过5000个字',
        'author.require' => '作者不能为空',


    ];
    protected $scene = [
        'add' =>['title','abstract','content','author'],
        'edit' =>['id','title','abstract','content','author']
    ];
}